<template>
  <div>api测试</div>
  <div>
    <div v-for="d in list" :key="d.pid">{{ d.province }}({{ d.pid }})</div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import type { TbProvince } from '@/types/Link'
import { Api } from '@/types/Api'
import type { BaseDataResult } from '@/types/BaseResult'

const list = ref([] as Array<TbProvince>)

const query = () => {
  Api.get('/link/provinces', {}, (data: BaseDataResult<Array<TbProvince>>) => {
    if (data.success) {
      list.value = data.data
      return
    }
    alert(data.message)
  })
}

query()
</script>
<style scoped></style>
